package com.woniuxy.empserver.servcie;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.woniuxy.empserver.entity.TEmp;
import com.woniuxy.empserver.mapper.TEmpMapper;
import com.woniuxy.empserver.vo.EmpVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class EmpService {

    @Autowired
    TEmpMapper empMapper ;

    public TEmp add(TEmp emp) {
        return emp ;
    }

    public TEmp Modify(TEmp emp) {
        return emp ;
    }

    public int removeByKey(int id) {
        return 0 ;
    }


    public PageInfo<EmpVo> findByPage(Integer now, Integer size, Integer deptId, String ename) {
        PageHelper.startPage(now,size);
        List<EmpVo> list = empMapper.selectEmpByCons(ename,deptId);
        return new PageInfo<>(list);
    }
}
